﻿using System;
using System.Collections.Generic;

using System.Windows;
using System.Windows.Controls;

using System.Windows.Input;

namespace EagleJournal
{
	public partial class CharmNotif : UserControl
	{
        public static readonly  RoutedEvent
            InvokeDismissEvent  = EventManager.RegisterRoutedEvent("InvokeDismiss", RoutingStrategy.Direct, typeof(RoutedEventHandler), typeof(CharmNotif));
        public event            RoutedEventHandler
            InvokeDismiss
        {
            add     { this.AddHandler(InvokeDismissEvent, value); }
            remove  { this.RemoveHandler(InvokeDismissEvent, value); }
        }

        public static readonly  RoutedEvent
            InvokeAlertEvent    = EventManager.RegisterRoutedEvent("InvokeAlert", RoutingStrategy.Direct, typeof(RoutedEventHandler), typeof(CharmNotif));
        public event            RoutedEventHandler
            InvokeAlert
        {
            add     { this.AddHandler(InvokeAlertEvent, value); }
            remove  { this.RemoveHandler(InvokeAlertEvent, value); }
        }

        public static readonly  DependencyProperty
            CharmMessageProperty            = DependencyProperty.Register("CharmMessage", typeof(string), typeof(CharmNotif));
        public                  string 
            CharmMessage
        {
            get { return (string)this.GetValue(CharmMessageProperty); }
            set { this.SetValue(CharmMessageProperty, value); }
        }

		public              CharmNotif              ()
		{
			this.InitializeComponent();
		}

        private     void    ButtonDissmiss_Click    (object sender, RoutedEventArgs e)
        {
            this.RaiseEvent(new RoutedEventArgs(InvokeDismissEvent));
        }

        public      void    ShowNotifCharm          (string message)
        {
            this.CharmMessage = message;

            this.RaiseEvent(new RoutedEventArgs(InvokeAlertEvent));
        }
	}
}